/**
* project  edu.lagou.com   stage1_module1
* @author libaice 
* @email libaice147@gmail.com
*/


import java.util.*;

public class extendArray
{
	public static void main (String[] args){
		System.out.println("Please input the length of the array");

		Scanner sc = new Scanner(System.in);
		int begin = sc.nextInt(); // (begin)  initlize the length of an array
		int end = 0;  
		
		int [] arr1 = new int [begin];

		System.out.println("Please input a Integer");
		
		int i = 0;
		while(sc.hasNextInt()){  // input a integer, else exit while loop, and input 
			if(((i+1)* 1.0)/ begin >= 0.8){
				System.out.println("up to the 80% of the Array, begin to extend the array");
				end = (int)(begin* 1.5); // (1.5 * begin) may be a double type number 
				int[] arr2 = new int[end];

				for (int j = 0;j < i ;j++ )
				{
					arr2[j] = arr1[j];
				}

				arr1 = arr2;  //new array -> old array
				begin = end;  // new length -> old length
			}

			arr1[i++] = sc.nextInt();
			System.out.println("please input a integer");

		
		}
		System.out.println(Arrays.toString(arr1));


	}
}